
#pragma once

namespace NT
{
namespace RENDERER
{
class NtD3DRenderer;
class NtTexture;

class NtTextureShader : public NtShader
{
	struct NtMatrixBuffer
	{
		D3DXMATRIX world;
		D3DXMATRIX view;
		D3DXMATRIX projection;
	};

public:
	NtTextureShader();
	~NtTextureShader();

	virtual bool Initialize(NtD3DRenderer* renderer, const NtWChar* vs, const NtWChar* ps);
	void Release();
	bool Render(NtD3DRenderer* renderer, int indexCount, const D3DXMATRIX& world, const D3DXMATRIX& view, const D3DXMATRIX& proj, NtUInt handle);

private:
	bool InitializeShader(NtD3DRenderer* renderer, HWND hwnd, NtWChar*, NtWChar* );
	void ReleaseShader();
	bool SetShaderParameter(NtD3DRenderer* renderer, const D3DXMATRIX& world, const D3DXMATRIX& view, const D3DXMATRIX& proj, NtUInt handle);
	void RenderShader(NtD3DRenderer* renderer, int indexCount);

private:
	ID3D11VertexShader*	m_vertexShader;
	ID3D11PixelShader*	m_pixelShader;
	ID3D11InputLayout*	m_layout;
	ID3D11Buffer*		m_matrixBuffer;
	ID3D11SamplerState*	m_sampleState;
};

}
}
